17d6841d4ba8553506e0a8facd9c43c10905ba0f,app/src/main/java/tech/ozak/sportmix/fragment/NtvSporFragment.java,NtvSporFragment,fillTheData,#,81
Before Change
private void fillTheData() {
SplashActivity splashActivity = SplashActivity.getInstance();
rssItems = splashActivity.getRssItems();
listData = new RssItem[rssItems.size()];
for (int i = 0; i < rssItems.size(); i++) {
listData[i] = rssItems.get(i);
}
ListView listView = (ListView) v.findViewById(R.id.postListView);
itemAdapter = new PostItemAdapter(getActivity(),
R.layout.postitem, listData);
AvocarrotInstream avocarrotInstream = new AvocarrotInstream(
itemAdapter, /* pass your listAdapter */
getActivity(), /* reference to your Activity */
getResources().getString(R.string.avarracot_api_key), /* this is your Avocarrot API Key */
getResources().getString(R.string.avarracot_ad_id) /* this is your Avocarrot Placement Key */
);
avocarrotInstream.setLogger(true, "ALL");
avocarrotInstream.setSandbox(true);
// Show ads every 15 cells starting from the 2nd cell.
avocarrotInstream.setFrequency(2,4);
// Bind the created avocarrotInstream adapter to your list instead of your listAdapter
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(avocarrotInstream);
swingBottomInAnimationAdapter.setAbsListView(listView);
listView.setAdapter(swingBottomInAnimationAdapter);
swipeRefreshLayout.setRefreshing(false);
}
After Change
ListView listView = (ListView) v.findViewById(R.id.postListView);
itemAdapter = new PostItemAdapter(getActivity(),
R.layout.postitem, rssItems);
// Bind the created avocarrotInstream adapter to your list instead of your listAdapter
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(itemAdapter);
swingBottomInAnimationAdapter.setAbsListView(listView);
listView.setAdapter(swingBottomInAnimationAdapter);
swipeRefreshLayout.setRefreshing(false);
}
}